package com.example.fsd.controller.banner;

import com.example.fsd.common.result.R;
import com.example.fsd.pojo.Banner;
import com.example.fsd.service.banner.IBannerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangguihong
 * @since 2024-11-20
 */
@RestController
@RequestMapping("/banner")
@RequiredArgsConstructor
public class BannerController {
    private final IBannerService bannerService;

    @GetMapping("/listBanner")
    private R listNavMenu(){
        return bannerService.listBanner();
    }
    @PostMapping("/updateBanner")
    private R updateBanner(MultipartFile file,Integer id){
        return bannerService.updateBanner(file,id);
    }

}
